class smx_upstream {

  require smx_os

  package { 'nginx':
    ensure => installed,
  }
  service { 'httpd':
    ensure => stopped,
    enable => false,
    before => Service['nginx'],
  }
  service { 'nginx':
    ensure  => running,
    enable  => true,
    require => Package['nginx'],
  }
  file { "/etc/nginx/nginx.conf":
    ensure  => file,
    require => Package['nginx'],
    notify  => Service['nginx'],
    source  => 'puppet:///modules/smx_upstream/nginx.conf',
  }
  file { '/etc/nginx/keys':
    ensure  => directory,
    group   => root, owner  => root,
    mode    => 644,
    require => Package['nginx'],
    notify  => Service['nginx'],
    source  => 'puppet:///modules/smx_upstream/keys',
    recurse => true,
  }
}
